Repository navigation
Use get_parent_theme_file_uri() for theme stylesheets - #150
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
add_editor_style() fetches full URLs over HTTP when the block editor loads. That request fails on hosts that block loopbacks, including wp-env, which drops the editor styles. Relative paths are read from disk, as in the default themes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MaggieCabrera
left a comment
There was a problem hiding this comment.
I kept your front-end change and reverted the add_editor_style() one. When it gets a full URL, the block editor fetches the file over HTTP on every load. That request fails on wp-env and on hosts that block requests back to themselves, so the editor styles disappear. Relative paths are read from disk, which is also what the default themes do.
Description
This is a small parent-theme improvement: load Ipsum’s stylesheets with
get_parent_theme_file_uri()so the parent CSS continues to load correctly when a child theme is active.Ipsum already works well on its own. Relative stylesheet paths and
get_stylesheet_directory_uri()resolve to the active theme, which is usually fine, but with a child theme they can point at the child instead of Ipsum. Usingget_parent_theme_file_uri()keeps parentstyle.cssandeditor-style.cssavailable in both cases, similar to Twenty Twenty-Five.Changes
functions.phpstyle.csswithget_parent_theme_file_uri( 'style.css' ).style.cssandassets/css/editor-style.csswithget_parent_theme_file_uri().No intentional visual change when Ipsum is used without a child theme.
Testing Instructions
npm run lint:phpif PHPCS is set up locally.Use of AI Tools